Crate esp_hal_smartled

source ·
Expand description

This adapter allows for the use of an RMT output channel to easily interact with RGB LEDs and use the convenience functions of the smart-leds crate.

This is a simple implementation where every LED is adressed in an individual RMT operation. This is working perfectly fine in blocking mode, but in case this is used in combination with interrupts that might disturb the sequential sending, an alternative implementation (addressing the LEDs in a sequence in a single RMT send operation) might be required!

Example

let io = IO::new(peripherals.GPIO, peripherals.IO_MUX);
let pulse = PulseControl::new(
    peripherals.RMT,
    &mut system.peripheral_clock_control,
    ClockSource::APB,
    0,
    0,
    0,
)
.unwrap();

let led = <smartLedAdapter!(1)>::new(pulse.channel0, io.pins.gpio0);

Macros

  • Macro to generate adapters with an arbitrary buffer size fitting for a specific number of $buffer_size LEDs to be addressed.

Structs

  • Adapter taking an RMT channel and a specific pin and providing RGB LED interaction functionality using the smart-leds crate

Enums

  • All types of errors that can happen during the conversion and transmission of LED commands